package com.eqs.enterprisequestionnaire.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.eqs.enterprisequestionnaire.model.pojo.Answer;
import com.eqs.enterprisequestionnaire.model.pojo.Response;
import com.eqs.enterprisequestionnaire.model.pojo.User;

import java.util.List;

public interface ResponseService extends IService<Response> {
    List<Response> selectAll(Response response);

    /*
     * 提交问卷
     * */
    void submit(Response response, List<Answer> answers);

    /*
    * 根据问卷Id查询所有答卷
    * */
    List<Response> selectAllResponse(Integer questionnaireId);
    /*
    * 新增回答
    * */
    void add(Response response);

    /*
    * 更新回答
    * */
    void updateResponse(Response response);

    /*
    * 根据回答获取用户
    * */
    User selectUser(Response response);

    /*
     * 开始作答
     * */
    Response start(Response response);
    /*
     * 修改答卷
     * */
    void updated(Response response, List<Answer> answers);
    Response submitWholeResponse(Response response);
    Response selectBy2Id(Integer userId,Integer questionnaireId);

    Response updateWholeResponse(Response response);

    Integer getResponseCountByQuestionId(Integer questionId);
}
